+function($){
  /*
  *删除回访记录
  */
  $('body').on('click', '.deleteShopCallback',function(){
      var content = '<span style="color:#d00">确定要删除这一条回访记录吗？</span>'+
                    '<div class="dialog-button"><button class="btn btn-sm btn-primary" id="callbackDelete" value="'+$(this).data('shopid')+'">确定</button><button style="margin-left:30px;" class="btn btn-sm btn-primary" id="closeDelete">取消</button></div>';
      deletedialog = dialog({
        title:'温馨提示',
        content: content,
        width:'300px',
        skin:'  dialog-box',
        lock:true,
        padding:'10px'
      }).showModal();
   });
  $('body').on('click', '#closeDelete', function() {
     deletedialog.close();
   });
  $('body').on('click', '#callbackDelete', function() {
      $.post("/shop/shop_callback_delete",{
        id:$(this).val()
      },function(data){
          location.reload(true);
      });
   });
  /*
  *修改回访记录
  */
  $('body').on('click', '.updateShopCallback',function(){
     callbackUpdate($(this));
   });
  $('body').on('click', '#callbackUpdate',function(){
      $.post("/shop/shop_callback_update",{
        id:$('#callbackUpdate').val(),
        val:$('#shopcallback').val()
      },function(){
          location.reload(true);
      });
   });
  /*
  *修改回访记录
  */
  var callbackUpdate = function($this){
     var str = '<ul>'+
      '<li><laber class="list-laber">回访内容：</laber><textarea name="shopcallback" class="list-textarea" id="shopcallback" rows="8" cols="38"></textarea></li>'+
      '<div class="dialog-button"><button class="btn btn-sm btn-primary" id="callbackUpdate">修　改</button></div>'+
      '</ul>';
      var d = dialog({
        title:'修改店铺信息',
        content: str,
        width:'450px',
        skin:'  dialog-box',
        lock:true,
        padding:'10px'
      }).showModal(callbackUpdateinit($this));
   }
  var callbackUpdateinit = function($this){
    $('#shopcallback').val($this.parent().prevAll('.J_callback').html());
    $('#callbackUpdate').val($this.data('shopid'));
  }
}(jQuery);
